home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 April: Mac OS SDK / Dev.CD Apr 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / PInterfaces / ControlStrip.p < prev    next >
Encoding:
Text File  |  1996-05-05  |  7.4 KB  |  219 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        ControlStrip.p
  3.  
  4.      Contains:    Control Strip (for Powerbooks and Duos) Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.1.3
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. }
  19.  
  20. {$IFC UNDEFINED UsingIncludes}
  21. {$SETC UsingIncludes := 0}
  22. {$ENDC}
  23.  
  24. {$IFC NOT UsingIncludes}
  25.  UNIT ControlStrip;
  26.  INTERFACE
  27. {$ENDC}
  28.  
  29. {$IFC UNDEFINED __CONTROLSTRIP__}
  30. {$SETC __CONTROLSTRIP__ := 1}
  31.  
  32. {$I+}
  33. {$SETC ControlStripIncludes := UsingIncludes}
  34. {$SETC UsingIncludes := 1}
  35.  
  36.  
  37. {$IFC UNDEFINED __TYPES__}
  38. {$I Types.p}
  39. {$ENDC}
  40. {    ConditionalMacros.p                                            }
  41.  
  42. {$IFC UNDEFINED __MENUS__}
  43. {$I Menus.p}
  44. {$ENDC}
  45. {    Memory.p                                                    }
  46. {        MixedMode.p                                                }
  47. {    Quickdraw.p                                                    }
  48. {        QuickdrawText.p                                            }
  49.  
  50. {$IFC UNDEFINED __DIALOGS__}
  51. {$I Dialogs.p}
  52. {$ENDC}
  53. {    Errors.p                                                    }
  54. {    Controls.p                                                    }
  55. {    Windows.p                                                    }
  56. {        Events.p                                                }
  57. {            OSUtils.p                                            }
  58. {    TextEdit.p                                                    }
  59.  
  60. {$PUSH}
  61. {$ALIGN MAC68K}
  62. {$LibExport+}
  63.  
  64. CONST
  65.     sdevInitModule                = 0;                            { initialize the module}
  66.     sdevCloseModule                = 1;                            { clean up before being closed}
  67.     sdevFeatures                = 2;                            { return feature bits}
  68.     sdevGetDisplayWidth            = 3;                            { returns the width of the module's display}
  69.     sdevPeriodicTickle            = 4;                            { periodic tickle when nothing else is happening}
  70.     sdevDrawStatus                = 5;                            { update the interface in the Control Strip}
  71.     sdevMouseClick                = 6;                            { user clicked on the module's display area in the Control Strip}
  72.     sdevSaveSettings            = 7;                            { saved any changed settings in module's preferences file}
  73.     sdevShowBalloonHelp            = 8;                            { puts up a help balloon, if the module has one to display}
  74.  
  75. {********************************************************************************************
  76.  
  77.     Features supported by the module.  If a bit is set, it means that feature is supported.
  78.     All undefined bits are reserved for future use by Apple, and should be set to zero.
  79.  
  80. ********************************************************************************************}
  81.     sdevWantMouseClicks            = 0;                            { notify the module of mouseDown events}
  82.     sdevDontAutoTrack            = 1;                            { call the module to do mouse tracking}
  83.     sdevHasCustomHelp            = 2;                            { module provides its own help messages}
  84.     sdevKeepModuleLocked        = 3;                            { module needs to be locked in the heap}
  85.  
  86. {********************************************************************************************
  87.  
  88.     Result values returned by the sdevPeriodicTickle and sdevIconMouseClick selectors.
  89.     If a bit is set, the module can request that a specific function is performed by
  90.     the Control Strip.  A result of zero will do nothing.  All undefined bits are reserved
  91.     for future use by Apple, and should be set to zero.
  92.  
  93. ********************************************************************************************}
  94.     sdevResizeDisplay            = 0;                            { resize the module's display}
  95.     sdevNeedToSave                = 1;                            { need to save changed settings, when convenient}
  96.     sdevHelpStateChange            = 2;                            { need to update the help message because of a state change}
  97.     sdevCloseNow                = 3;                            { close a module because it doesn't want to stay around}
  98.  
  99. {********************************************************************************************
  100.  
  101.     miscellaneous
  102.  
  103. ********************************************************************************************}
  104.     sdevFileType                = 'sdev';
  105.  
  106.     sdevMenuItemMark            = '•';
  107.  
  108. {    direction values for SBDrawBarGraph}
  109.     BarGraphSlopeLeft            = -1;                            { max end of sloping bar graph is on the left}
  110.     BarGraphFlatRight            = 0;                            { max end of flat bar graph is on the right}
  111.     BarGraphSlopeRight            = 1;                            { max end of sloping bar graph is on the right}
  112.  
  113. {********************************************************************************************
  114.  
  115.     utility routines to provide standard interface elements and support for common functions
  116.  
  117. ********************************************************************************************}
  118.  
  119. FUNCTION SBIsControlStripVisible: BOOLEAN;
  120.     {$IFC NOT GENERATINGCFM}
  121.     INLINE $7000, $AAF2;
  122.     {$ENDC}
  123. PROCEDURE SBShowHideControlStrip(showIt: BOOLEAN);
  124.     {$IFC NOT GENERATINGCFM}
  125.     INLINE $303C, $0101, $AAF2;
  126.     {$ENDC}
  127. FUNCTION SBSafeToAccessStartupDisk: BOOLEAN;
  128.     {$IFC NOT GENERATINGCFM}
  129.     INLINE $7002, $AAF2;
  130.     {$ENDC}
  131. FUNCTION SBOpenModuleResourceFile(fileCreator: OSType): INTEGER;
  132.     {$IFC NOT GENERATINGCFM}
  133.     INLINE $303C, $0203, $AAF2;
  134.     {$ENDC}
  135. FUNCTION SBLoadPreferences(prefsResourceName: ConstStr255Param; VAR preferences: Handle): OSErr;
  136.     {$IFC NOT GENERATINGCFM}
  137.     INLINE $303C, $0404, $AAF2;
  138.     {$ENDC}
  139. FUNCTION SBSavePreferences(prefsResourceName: ConstStr255Param; preferences: Handle): OSErr;
  140.     {$IFC NOT GENERATINGCFM}
  141.     INLINE $303C, $0405, $AAF2;
  142.     {$ENDC}
  143. PROCEDURE SBGetDetachedIndString(theString: StringPtr; stringList: Handle; whichString: INTEGER);
  144.     {$IFC NOT GENERATINGCFM}
  145.     INLINE $303C, $0506, $AAF2;
  146.     {$ENDC}
  147. FUNCTION SBGetDetachIconSuite(VAR theIconSuite: Handle; theResID: INTEGER; selector: LONGINT): OSErr;
  148.     {$IFC NOT GENERATINGCFM}
  149.     INLINE $303C, $0507, $AAF2;
  150.     {$ENDC}
  151. FUNCTION SBTrackPopupMenu({CONST}VAR moduleRect: Rect; theMenu: MenuHandle): INTEGER;
  152.     {$IFC NOT GENERATINGCFM}
  153.     INLINE $303C, $0408, $AAF2;
  154.     {$ENDC}
  155. FUNCTION SBTrackSlider({CONST}VAR moduleRect: Rect; ticksOnSlider: INTEGER; initialValue: INTEGER): INTEGER;
  156.     {$IFC NOT GENERATINGCFM}
  157.     INLINE $303C, $0409, $AAF2;
  158.     {$ENDC}
  159. FUNCTION SBShowHelpString({CONST}VAR moduleRect: Rect; helpString: StringPtr): OSErr;
  160.     {$IFC NOT GENERATINGCFM}
  161.     INLINE $303C, $040A, $AAF2;
  162.     {$ENDC}
  163. FUNCTION SBGetBarGraphWidth(barCount: INTEGER): INTEGER;
  164.     {$IFC NOT GENERATINGCFM}
  165.     INLINE $303C, $010B, $AAF2;
  166.     {$ENDC}
  167. PROCEDURE SBDrawBarGraph(level: INTEGER; barCount: INTEGER; direction: INTEGER; barGraphTopLeft: Point);
  168.     {$IFC NOT GENERATINGCFM}
  169.     INLINE $303C, $050C, $AAF2;
  170.     {$ENDC}
  171. PROCEDURE SBModalDialogInContext(filterProc: ModalFilterUPP; VAR itemHit: INTEGER);
  172.     {$IFC NOT GENERATINGCFM}
  173.     INLINE $303C, $040D, $AAF2;
  174.     {$ENDC}
  175. { The following routines are available in Control Strip 1.2 and later. }
  176. FUNCTION SBGetControlStripFontID(VAR fontID: INTEGER): OSErr;
  177.     {$IFC NOT GENERATINGCFM}
  178.     INLINE $303C, $020E, $AAF2;
  179.     {$ENDC}
  180. FUNCTION SBSetControlStripFontID(fontID: INTEGER): OSErr;
  181.     {$IFC NOT GENERATINGCFM}
  182.     INLINE $303C, $010F, $AAF2;
  183.     {$ENDC}
  184. FUNCTION SBGetControlStripFontSize(VAR fontSize: INTEGER): OSErr;
  185.     {$IFC NOT GENERATINGCFM}
  186.     INLINE $303C, $0210, $AAF2;
  187.     {$ENDC}
  188. FUNCTION SBSetControlStripFontSize(fontSize: INTEGER): OSErr;
  189.     {$IFC NOT GENERATINGCFM}
  190.     INLINE $303C, $0111, $AAF2;
  191.     {$ENDC}
  192. FUNCTION SBGetShowHideHotKey(VAR modifiers: INTEGER; VAR keyCode: CHAR): OSErr;
  193.     {$IFC NOT GENERATINGCFM}
  194.     INLINE $303C, $0412, $AAF2;
  195.     {$ENDC}
  196. FUNCTION SBSetShowHideHotKey(modifiers: INTEGER; keyCode: ByteParameter): OSErr;
  197.     {$IFC NOT GENERATINGCFM}
  198.     INLINE $303C, $0213, $AAF2;
  199.     {$ENDC}
  200. FUNCTION SBIsShowHideHotKeyEnabled(VAR enabled: BOOLEAN): OSErr;
  201.     {$IFC NOT GENERATINGCFM}
  202.     INLINE $303C, $0214, $AAF2;
  203.     {$ENDC}
  204. FUNCTION SBEnableShowHideHotKey(enabled: BOOLEAN): OSErr;
  205.     {$IFC NOT GENERATINGCFM}
  206.     INLINE $303C, $0115, $AAF2;
  207.     {$ENDC}
  208.  
  209. {$ALIGN RESET}
  210. {$POP}
  211.  
  212. {$SETC UsingIncludes := ControlStripIncludes}
  213.  
  214. {$ENDC} {__CONTROLSTRIP__}
  215.  
  216. {$IFC NOT UsingIncludes}
  217.  END.
  218. {$ENDC}
  219.